Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

more Momentum options, mostly related to hFac #809

Open
wants to merge 23 commits into
base: master
Choose a base branch
from

Conversation

jm-c
Copy link
Member

@jm-c jm-c commented Feb 4, 2024

What changes does this PR introduce?

Alternative discretization related to hFac for few momentum tendency terms that greatly improve Angular-Momentum (AM) conservation in one weakly-forced, deep NH model set-up with zonally uniform geometry.

Some choices are certainly useful to have (first in the list) whereas some other might not add much.
These new choices are, starting from the most useful and/or with larger impact on AM-budget:

  1. Flux-Form coriolis, selectCoriScheme=4 (mom_u,v_coriolis.F) :
    use averaged transport so that the column integrated Coriolis tendency (gU,gV) match the Coriolis parameter times the integrated transport ( +f.V, -f.U )
  2. Vect-Inv vorticity-advection, selectVortScheme=4 (mom_vi_u,v_coriolis.F) :
    by-pass division by hFacZ and instead apply recip_hFacW/S on final tendency.
    Note: this fixes AM-conservation but breaks vorticity tendency matching advection of vorticity
  3. pkg/mom_common, 3-d Coriolis, select3dCoriScheme= 2,3 (mom_u,v,w_coriolis_nh.F) :
    Alternative discretization using averaged transport ; distinction betewenn 2 and 3 only for vertical momentum tendency gW (but unclear which one is better/more consistent).
  4. deep-model, gU,gV NH-metric terms inside vertical advection :
    This exactly conserves AM and also simplify (+ speeds up) the code by skipping completely the NH metric-terms calculation for horizontal momentum tendency.
    No run-time switch but a CPP option "MOM_USE_OLD_DEEP_VERT_ADV" (in MOM_COMMON_OPTIONS.h) allows to recover the explicit NH metric-term calculation.
    <-- this affects many routines in the 3 momentum pkgs, including mom_init_fixed.F, MOM_VISC.h in pkg/mom_common + new argument to vertical advection S/R (in mom_fluxform & mom_vecinv pkgs).
  5. Flux-Form, spherical Metric-terms, selectMetricTerms = 2,3 (mom_fluxform.F, mom_u,v_metric_sphere.F, mom_u_adv_vu.F) :
    More accurate discretization, involves similar averaving as the ones described in manual eq. 2.102 & 2.103 but instead centered at grid-cell corner.
    Also offer the option (selectMetricTerms=3) to skip the gU spherical metric term by advecting uVel*dxC (simpler, faster, and exactly conserve AM).
  6. Add diagnostics for Metric-terms.

What is the current behaviour?

What is the new behaviour

Does this PR introduce a breaking change?

Other information:

Suggested addition to tag-index

to be filled later

This switch allows to compute Coriolis terms, both horizontal (in 2.Omega.sin(Phi))
and NH (in 2.Omega.cos(Phi)), using the averaged transport (with face edge length
and hFac factor), as done previously in V.I. for horizontal Coriolis.
For deep-model, absorb the NH-metric terms w.(u,v)/r into vertical advection
by advecting the product "deepFac x (u,v)" (instead of just u,v).
- Add recip_hFacW/S (previously commented out) in new expression
  (selectCoriScheme=4) of NH coriolis f'*W term
- remove hFacW/S from gW-Cori in selectCoriScheme=4 code and keep previous
  selectCoriScheme=4 code (with hFacW/S) under selectCoriScheme=6 block
- New Spherical-Metric term form using grid-spacing finite differences (instead
  of analytical tan(Phi)/rSphere), supposed to improve both AM and KE conservation.
  Used (turned on) when selectVortScheme=1,2.
- Add option to absorb the spherical-metric terms uMetricTerms = u.v.tanPhi/r
  into meridional advection by advecting the product "dxC x u" (instead of just u).
  Used (turned on) when selectVortScheme=2.
Note: for now, re-cycle Flux-Form unused param "selectVortScheme" for this.
This option (selectCoriScheme=6, in mom_w_coriolis_nh.F) was left from early
test, with hFacW/S multiplying uVel,vVel, but without scaling by any recip_hFac.
The changes here fix this issue as the gW-Cori term is now divided by the
grid-cell thickness at the wVel location (new argument recip_rThickC).
Two improvements:
- single CPP option "MOM_USE_OLD_DEEP_VERT_ADV" in MOM_COMMON_OPTIONS.h to
  disable changes to vertical advection for deepAtmosphere=T
- fix for the case useNHTerms=F with deepAtmosphere=T.
Done by keeping a local copy of deepFacC in MOM_VISC.h, and adding 1 new
argument to S/R mom_u_adv_wu.F, mom_v_adv_wv.F, mom_vi_{u,v}_vertshear.F
This new option (with selectCortScheme=4) skip the division of vorticity
by hFacZ and replace it with tendency scaling by recip_hFacW/S
Also:
 - remove code related to "upwindVort3" (was hard-coded to FALSE)
 - add some missing "_d 0" ; + minor indentation changes
no need to hack selectCoriScheme params and leave mom_vi_coriolis.F unchanged
- no need to hack selectVortScheme param
- compute advection tendency in separated block if selectMetricTerms
  This makes sure results will not be affected (at trucation level)
  with current default metric-terms.
- minor cleaning in mom_u/v_coriolis.F and mom_u/v_adv_wu/v.F
@jm-c jm-c added work in progress Should not be merged until this label is removed adjoint Affects the adjoint model; label triggers full OpenAD test labels Feb 4, 2024
jm-c added 10 commits March 5, 2024 15:14
also rename 2 local variables (vF & v4F) more inline with other S/R
and improve description
using vector-invariant momentum
With deep-model, gU,gV NHMtTerms have been moved inside vertical momentum advection
and this affects results (11 remaining matching digits for cg2d); update primary test
ref. output and add ref-output for new (vector-inv) secondary test.
@jm-c jm-c removed the work in progress Should not be merged until this label is removed label Aug 1, 2024
@jm-c
Copy link
Member Author

jm-c commented Aug 1, 2024

I think this PR is ready for review: I updated config_summary.F with the new choices and added a secondary test in exp. deep_anelastic to test vector-inv. in deep-model. This exp. is not the best test since bottom and top are flat and will work on adding a non-flat bottom/top new deep test but will be in verification_other (so not part of this PR).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
adjoint Affects the adjoint model; label triggers full OpenAD test
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant